<script type="text/javascript">
$(function() {
	//More Button
	$('.more').live("click",function() {
		var ID = $(this).attr("id");
		var idnhom = $('#idnhom').val();
		var duong = $('#duong').val();
		if(ID)
			{
				
				$.ajax({
					type: "POST",
					url: "pages/ket-qua-tim-kiem-nhom-duong-view-more.php",
					data: "idnhom="+idnhom+"&lastid="+ID+"&duong="+duong, 
					cache: false,
					success: function(html){
					$(".place-list").append(html);
					$("#more"+ID).remove();
				}	
			});
		}
		
	
	});
});
</script>
<?
	$id;
	$name;

	if(isset($_REQUEST['id'])&&isset($_REQUEST['name'])){
		$id = $_REQUEST['id'];
		$name = $_REQUEST['name'];
	}
$where;
$what;
if(isset($_REQUEST['what'])&&isset($_REQUEST['where'])){
			$what = $_REQUEST['what'];
			$where = $_REQUEST['where'];
		}
	$n=$total_place;
printf($sql);
?>


<title><?=$name?> - <?=$where?> - <?=$title?></title>
<div id="maincontent">
	<div class="boxbig">
	<h1 class="titlebig">Có <?=$total_place?> địa điểm - <?=$name?> - <?=$where?></h1>
    <div class="boxbigcontent">
    
    	<div class="search-result">
        
        	<?
			
            ?>
            <div class="clear"> </div>
            <div class="place-list">
            <? 
			if($total_place>0){
				$l = count($arrDDFirst);
				$l_p = $arrDDFirst[$l-1];
				$id_l = $l_p['MaDiaDiem'];
			
				foreach($arrDDFirst as $row){
					$image = $xl_hinh_anh->hinhAnhDiaDiem($row['MaDiaDiem']);
					$hinhdaidien = $image[0]['DuongDan'];
					$sobinhluan = $xl_binh_luan->tong_binh_luan($row['MaDiaDiem']);
			?>
            	<div class="place-item"><!--một địa điểm-->
                	<div class="place-avatar">
                    	<?
							if($hinhdaidien != ''){					
						?>
                        <a href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                        <img src="uploads/place/<?=$hinhdaidien?>" alt="<?=$row['TenDiaDiem']?>">
                        </a>
						<? } else{?>
                        <a href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                        	<img src="uploads/place/photo_not_available.png" alt="<?=$row['TenDiaDiem']?>">
                        </a>
                        <? }?>
                    </div>
                    <ul class="place-info">
                    	<li class="first">
                        	<a class="place-title" title="<?=$row['TenDiaDiem']?>" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>"><?=$row['TenDiaDiem']?></a>
                        </li>
                        <li>
                        <span class="address-details"><?=$row['DiaChi']?> - <?=$row['TenQuanHuyen']?> - <?=$row['TenTinhThanh']?></span>
                        </li>
                        <li>
                        <img class="icon" title="lượt xem" src="images/icon_views.png">
                        Lượt xem:
                        <span class="page-views"><?= number_format($row['SoLuotXem'],0,',',',')?></span>
                        </li>
                        <li>
                        <img class="icon" title="bình luận" src="images/icon_comment.png">
                        Bình luận:
                        <span class="comment-no"><?=number_format($sobinhluan,0,',',',')?></span>
                        </li>
                        
                    </ul>
                	<div class="clear"></div>
                </div><!--[end] một địa điểm-->
                <?
				}
			
            }
			else
			{
			?>
          <div class="search-result">
            	Không tìm thấy địa điểm nào????
          </div>
            <?
			
            }
			
			
				if($l>=10)
				{
                ?>
                <div class="place-item last" id="more<?=$id_l?>"><!--xem thêm-->
                	<input type="hidden" id="idnhom" name="idnhom" value="<?=$l_p['MaNhomDiaDiem']?>" />
                    <input type="hidden" id="duong" name="duong" value="<?=$duong?>" />
                    
                	<a id="<?=$id_l?>" class="more">xem thêm</a>
					<div class="clear"></div>
                </div><!--[end] xem thêm-->
                <?
				}
                ?>
            </div>
            
        </div>
    </div>
    
    <div class="boxbigcontentbottom"></div>
    </div>
</div>
<!--menu right-->
<div id="nav">
	<div class="boxnav">
    	<h3 class="titlenav"> Địa điểm mới cập nhật</h3>
    	<div class="boxnavcontent">
        	<div class="place-list-small"><!--danh sách địa điểm-->
            	<?
					foreach($arrDiaDiemMoiCapNhat as $row){
						$arrPic = $xl_hinh_anh->hinhAnhDiaDiem($row['MaDiaDiem']);
						$pic = $arrPic[0]['DuongDan'];
						$sobinhluan = $xl_binh_luan->tong_binh_luan($row['MaDiaDiem']);
				?>
                <div class="place-item">
                    <div class="place-avatar">
                    <a class="placeTracking" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>">
                    <img  src="uploads/place/<? if($pic!=""){ echo $pic; }else{ ?>photo_not_available.png<? } ?>" alt="<?=$row['TenDiaDiem']?>">
                    </a>
                    </div>
                    <ul class="place-info">
                    <li>
                    <a class="place-title placeTracking" title="<?=$row['TenDiaDiem']?>" href="./?action=dia-diem&idPlace=<?=$row['MaDiaDiem']?>"><?=$row['TenDiaDiem']?></a>
                    </li>
                    <li>
                    <span class="address-details"><?=$row['DiaChi']?></span>
                    </li>
                    <li>
                    <div class="icon">
                    <img title="lượt xem" src="images/icon_views.png">
                    <span title="lượt xem"><?= number_format($row['SoLuotXem'],0,',',',')?></span> Lượt xem
                    <img title="bình luận" src="images/icon_comment.png">
                    <span title="bình luận"><?=number_format($sobinhluan,0,',',',')?></span> Bình luận
                    </div>
                    </li>
                    </ul>
                    <div class="clear"> </div>
                 </div>
                <? } ?>
               
                
            </div><!--[end] danh sách địa điểm -->
            
           
            
        </div>
    </div>
</div>
 <div class="boxbigcontentbottom"></div>
<div class="clear"></div>     
 